#pragma once


#define EventVolChange EventSliderPos
#define EventVolChangeID EventSliderPos::EventID

namespace SOUI
{
	class SVolCtrl :public SWindow
	{
		SOUI_CLASS_NAME(SVolCtrl, L"volctrl")		
	public:
		SVolCtrl();
		~SVolCtrl();
		void SetLoud(bool isLoud);
		void SetMuted(bool bMuted);
	protected:
		virtual BOOL NeedRedrawWhenStateChange()
		{
			return FALSE;
		}
		void OnLButtonUp(UINT nFlags, CPoint point);
		void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
		void OnPaint(IRenderTarget *pRT);
		BOOL OnEraseBkgnd(IRenderTarget *pRT) { return TRUE; }
		UINT _GetDrawState();
		CRect GetCheckRect();
		CSize GetDesiredSize(LPCRECT pRcContainer);
		SOUI_ATTRS_BEGIN()
		SOUI_ATTRS_END()
		SOUI_MSG_MAP_BEGIN()
			MSG_WM_PAINT_EX(OnPaint)
			MSG_WM_ERASEBKGND_EX(OnEraseBkgnd)
			MSG_WM_LBUTTONUP(OnLButtonUp)
			MSG_WM_KEYDOWN(OnKeyDown)
		SOUI_MSG_MAP_END()
	};
}

